package net.bw.realtime.tmall.mapper;

import net.bw.realtime.tmall.bean.SaleSkuReport;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*
 * @ Author：liuyawei
 * @ Date：2025-05-28
 */
public interface SaleSkuStatsMapper {

    @Select("SELECT\n" +
            " sku_name,\n" +
            " sum(sku_total_amount) AS sale_amount\n" +
            "FROM jtp_tmall_report.dws_sku_count_window_report\n" +
            "WHERE toDate(window_start_time) = #{date}\n" +
            "GROUP BY sku_name")
    List<SaleSkuReport> selectSaleAmount(String date);

    //todo b-1 商品总销量
    @Select("SELECT\n" +
            "    sum(sku_count) as sku_count\n" +
            "FROM jtp_tmall_report.dws_sku_count_window_report\n" +
            "WHERE toDate(window_start_time) = #{date}")
    Double selectSkuCount(String date);

}
